package com.bdqn.shiro.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.shiro.config.mybatis.ServiceImpl;
import com.bdqn.shiro.pojo.BasDict;
import com.bdqn.shiro.pojo.SalChance;
import com.bdqn.shiro.service.BasDictService;
import com.bdqn.shiro.mapper.BasDictMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 */
@Service
public class BasDictServiceImpl extends ServiceImpl<BasDictMapper, BasDict>
    implements BasDictService{

    @Resource
    private BasDictMapper basDictMapper;

    @Override
    public List<BasDict> getList(Page<BasDict> page, BasDict basDict) {
        return basDictMapper.getList(page,basDict);
    }

    @Override
    public boolean saveBasDict(BasDict basDict) {
        Integer chcId=Integer.valueOf(basDict.getDictId().toString());
        if (chcId>0 && chcId!=null){
            basDictMapper.updateById(basDict);
        }else{
            basDictMapper.insert(basDict);
        }
        return true;
    }
}




